﻿namespace ConsoleApp4
{
    //本地函数
    internal class Program
    {
        static void Main()
        {
            int a = 10;
            int b = 5;

            int result = AddAndMultiply(a, b);
            Console.WriteLine($"Result: {result}");
        }

        static int AddAndMultiply(int x, int y)
        {
            //本地函数一
            int Add(int num1, int num2)
            {
                return num1 + num2;
            }
            //本地函数二
            int Multiply(int num1, int num2)
            {
                return num1 * num2;
            }

            int sum = Add(x, y);
            int product = Multiply(x, y);

            return sum + product;
        }
    }
}